//
//  HomePageHeadView.m
//  LastTemp
//
//  Created by dllo on 15/4/24.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "HomePageHeadView.h"

@implementation HomePageHeadView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addheadView];
    }
    return self;
}

- (void)addheadView
{
    
    
    self.headView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    [self addSubview:self.headView];
    [_headView release];
    self.headImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    [self.headView addSubview:self.headImageView];
    [_headImageView release];
    self.headImageView.image = [UIImage imageNamed:@"8.jpg"];
    self.headImageView.alpha = 0.5;
    
 
    self.labelHot = [[UILabel alloc] initWithFrame:CGRectMake(0, 310, self.headView.frame.size.width, 20)];
    [self.headView addSubview:self.labelHot];
    self.labelHot.text = @"  | 热门歌曲";
    self.labelHot.font = [UIFont systemFontOfSize:17];
    [_labelHot release];
    
    self.labelGive = [[UILabel alloc] initWithFrame:CGRectMake(0, 180, self.headView.frame.size.width, 20)];
    [self.headView addSubview:self.labelGive];
    self.labelGive.text = @"  | 推荐歌单";
    self.labelGive.font = [UIFont systemFontOfSize:17];
    [_labelGive release];
    
    
   
    
    
    self.imageViewOne = [[UIImageView alloc] initWithFrame:CGRectMake(15, 210, self.headView.frame.size.width/3-40, self.headView.frame.size.width/3-40)];
    [self.headView addSubview:self.imageViewOne];
    [_imageViewOne release];
//    self.imageViewOne.layer.cornerRadius = 30;
    self.imageViewOne.clipsToBounds = YES;
   
//    self.imageViewOne.layer.borderWidth = 5;
  
    
   
    self.labelOne = [[UILabel alloc] initWithFrame:CGRectMake(15, 210+self.headView.frame.size.width/3-40, self.headView.frame.size.width/3-40, 15)];
    self.labelOne.font = [UIFont systemFontOfSize:13];
    [self.headView addSubview:self.labelOne];
    [_labelOne release];
    
    
    
    self.imageViewTwo = [[UIImageView alloc] initWithFrame:CGRectMake(self.headView.frame.size.width/3+15, 210, self.headView.frame.size.width/3-40, self.headView.frame.size.width/3-40)];
    [self.headView addSubview:self.imageViewTwo];
    [_imageViewTwo release];
//    self.imageViewTwo.layer.cornerRadius = 10;
    self.imageViewTwo.clipsToBounds = YES;
    
   
    self.labelTwo = [[UILabel alloc] initWithFrame:CGRectMake(self.headView.frame.size.width/3+15, 210+self.headView.frame.size.width/3-40, self.headView.frame.size.width/3-40, 15)];
    self.labelTwo.font = [UIFont systemFontOfSize:13];
    [self.headView addSubview:self.labelTwo];
    [_labelTwo release];
    
    
    
    self.imageViewThree = [[UIImageView alloc] initWithFrame:CGRectMake((self.headView.frame.size.width/3)*2+15, 210, self.headView.frame.size.width/3-40, self.headView.frame.size.width/3-40
                                                                        )];
    [self.headView addSubview:self.imageViewThree];
    [_imageViewThree release];
//    self.imageViewThree.layer.cornerRadius = 10;
    self.imageViewThree.clipsToBounds = YES;
    self.labelThree = [[UILabel alloc] initWithFrame:CGRectMake((self.headView.frame.size.width/3)*2+15, 210+self.headView.frame.size.width/3-40, self.headView.frame.size.width/3-40, 15)];
    self.labelThree.font = [UIFont systemFontOfSize:13];
    [self.headView addSubview:self.labelThree];
    [_labelThree release];

    
    
}



- (void)dealloc
{
    [_headView release];
    [_buttonOne release];
    [_buttonTwo release];
    [_buttonThree release];
    [_labelOne release];
    [_labelTwo release];
    [_labelThree release];
    [_imageViewOne release];
    [_imageViewTwo release];
    [_imageViewThree release];
    [_labelHot release];
    [_labelGive release];
    [super dealloc];
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
